package cn.ren.service;

import cn.ren.dao.AssessmentDao;
import cn.ren.entity.PageResult;
import cn.ren.pojo.Assessment;
import cn.ren.pojo.Setmeal;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service(interfaceClass = AssessmentService.class)
@Transactional
public class AssessmentServiceImpl implements AssessmentService {

    @Autowired
    private AssessmentDao assessmentDao;

    @Override
    public PageResult dj_findPage(Integer currentPage, Integer pageSize, String queryString) {
        PageHelper.startPage(currentPage,pageSize);
        Page<Assessment> page =assessmentDao.dj_findByCondition(queryString);
        List<Assessment> list = page.getResult();
        for (Assessment assessment : list) {
            assessment.setDoctor("张医生");
            assessment.setStatus("未出报告");
        }
        return new PageResult(page.getTotal(),page.getResult());
    }
}
